import React, { useState, useEffect, useRef } from 'react';

import Select from './components/select/Select';
export default function(props){
  const [state, setState] = useState()

  const [count, setCount] = useState(0)
  const prevCountRef = useRef();

  useEffect(() => {
    prevCountRef.current = count;
    // console.log("---", )
    // if(Component.prototype.isReactComponent === {}) {
    //   console.log('00')
    // }
  })

  const prevCount = prevCountRef.current;

  const [arr, setArr] = useState([
    {name:'总共点击关闭按钮N次后消失', N: 4}, 
    {name:'每N天展示M次后消息', N:2, M:15}, 
    {name: '总共展示N次', N: 3}, 
    {name: 'N天内展示M次', N: 4, M: 16},
    {name: "N天内点击M次", N: 5, M: 16},
    {name: "N天只投放M天", N: 6, M: 16}
  ])

  const onChange = (data) => {
    console.log("返回的数据", data)
  }

  return (
    <div>
      {/* <h2 onClick={() => setCount(count+1)} > Now: {count}, before: {prevCount} </h2> */}
        组件
        <Select arr={arr} onChange={onChange} />
    </div>
  )
}


